//
//  Assemble.m
//  ArchitectDemo
//
//  Created by 姚胜龙 on 2017/7/5.
//  Copyright © 2017年 姚胜龙. All rights reserved.
//

#import "Assemble.h"

@interface Assemble ()

@property (nonatomic, strong) id<IComputerBuilder> builder;

@end

@implementation Assemble

- (instancetype)initWithBuilder:(id<IComputerBuilder>)builder {
    self = [super init];
    if (self) {
        _builder = builder;
    }
    return self;
}

- (void)constructComputerCPU:(NSString *)cpu
                     display:(NSString *)display
                   mainboard:(NSString *)mainboard
                          os:(NSString *)os {
    //链式编程
    [[[[[_builder buildCPU:cpu] buildDisplay:display] buildMainboard:mainboard] buildOS:os] build];

}


@end
